package cn.bearspark.comment.provider.dao.buffer;

import cn.bearspark.comment.provider.dao.co.BldgCommentCO;
import cn.bearspark.comment.provider.dao.key.BldgCommentBufferKeyBuilder;
import cn.bearspark.comment.provider.dao.mapper.BldgCommentMapper;
import cn.bearspark.framework.redis.starter.buffer.hash.un.RedisHashBuffer;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * 楼评论数据的缓存器
 *
 * @author f
 */
@Component
public class BldgCommentBuffer extends RedisHashBuffer<BldgCommentCO> {

    /**
     * 设置楼评论数据的缓存的有效期（单位：s），默认是 1min
     */
    private static final int BLDG_COMMENT_INFO_CACHE_EXPIRE = 60;

    public BldgCommentBuffer(RedisTemplate<String, Object> redisTemplate,
                             BldgCommentBufferKeyBuilder bldgCommentBufferKeyBuilder,
                             BldgCommentMapper bldgCommentMapper) {
        super(
                redisTemplate,
                bldgCommentBufferKeyBuilder,
                BLDG_COMMENT_INFO_CACHE_EXPIRE,
                BldgCommentCO.class,
                bldgCommentMapper
        );
    }

}
